package com.zgh.controller;

import com.baomidou.mybatisplus.extension.api.R;
import com.zgh.domain.Province;
import com.zgh.domain.Result;
import com.zgh.service.ProvinceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/province")
public class ProvinceController {
    @Autowired
    private ProvinceService provinceService;
    //根据省份获取省份详细信息
    @RequestMapping(value = "/getProvinceInfo/{provinceName}",method = RequestMethod.GET)
    public Result getProvinceInfo(@PathVariable String provinceName){
        Province province = provinceService.findProvinceByName(provinceName);
        return new Result(true,"查询成功",province);
    }
}
